<script src="<?php echo base_url('assets/js/admin/pagination.js'); ?>" type="text/javascript"></script>
<div role="main" class="column grid-8" id="content">
    <div class="section">
        <h3 id="page-title" class="title"><?php echo $titulo; ?></h3>

        <div class="page-content">
            <div class="region region-content">
                <div class="block block-system block-even" id="block-system-main">
                    <div class="block-title">
                    </div>

                    <div class="content">

                        <?php
                        $id_objeto = $this->uri->segment(4);
                        if (!empty($posts)) {
                            $index = 1;
                            $last = count($posts);
                            foreach ($posts as $item) {
                                include __DIR__ . DIRECTORY_SEPARATOR . 'article.php';
                                if ($index++ != $last){
                                    echo '<hr class="fancy-line"/>';
                                }
                                
                            }
                        
                            $config['uri_segment'] = 5;
                            $config['total_rows'] = $total;
                            $config['per_page'] = LIMITE_PAGINACAO_ADMIN;
                            $config['base_url'] = site_url('site/post/index/'. $id_objeto);
                            $config['use_page_numbers'] = TRUE;
                            $this->pagination->initialize($config);
                            printf('<div class="item-list">
                                    <ul class="pager">
                                        %s 
                                    </ul>
                                </div>'
                                    , $this->pagination->create_links()
                            );
                        } else {
                            echo '<p class="nenhum-resultado" style="padding: 3px 0; margin: 0;">Nenhum post foi adicionado.</p>';
                        }
                        ?>
                    </div><!-- /.content -->
                </div><!-- /.block -->  </div>
        </div>
    </div>
</div>